<?php
namespace App\Repositories\Api;
use App\Repositories\AreaRepository;
use App\Repositories\Api\MemberRepository;

use App\Models\Member;
use Exception;

class WechatMenusRepository
{

    public function getMemberCategoryForMember($unset_cids = "")
    {
        $model_set_fields = array(
            // ['title' => "头像", "id" => 12, 'type' => "picture",],
            ['title' => "基本信息", "id" => 1, 'fields' => array('id', 'birthday','height','marital_history','ismyself','make_friend_type')],
            ['title' => "个人相册", "id" => 6, 'type' => "picture"],
            ['title' => "联系方式", "id" => 3, 'fields' => array('mobile','weixin','weixin_qrcode_pic')],
            ['title' => "认证", "id" => 14, 'fields' => array('idcard_status','status')],
            ['title' => "坐标", "id" => 2, 'fields' => array('location','work_or_study_place','residence','hometown','country','last_login_ip_title')],
            ['title' => "学校", "id" => 4, 'fields' => array('undergraduate','master_college','doctor_college','education','profession','current_status')],
            ['title' => "工作", "id" => 5, 'fields' => array('work_org','work_status','occupation','work_type','year_salary')],
            ['title' => "住房/家庭情况", "id" => 8,'fields' => array('goufang_condition','famliy_condition')],
            ['title' => "想说的话", "id" => 9, 'fields' => array('about_me','about_you')],
        );

        $unset_cids =  array_filter(explode(",", $unset_cids));
        foreach ($model_set_fields as $k => $v) {
            if(in_array($v['id'], $unset_cids)){
                unset($model_set_fields[$k]);
                continue;
            }
        }

        return $model_set_fields;
    }

     public function getMemberCategoryForProfile()
    {
        $model_set_fields = array(
            // ['title' => "头像", "id" => 12, 'type' => "picture",],
            ['title' => "个人相册", "id" => 6, 'type' => "picture"],
            ['title' => "基本信息", "id" => 1, 'fields' => array('id', 'birthday','height','marital_history','ismyself','make_friend_type')],
            ['title' => "联系方式", "id" => 3, 'fields' => array('mobile','weixin','weixin_qrcode_pic')],
            ['title' => "认证", "id" => 14, 'fields' => array('idcard_status','status')],
            ['title' => "坐标", "id" => 2, 'fields' => array('location','work_or_study_place','residence','hometown','country')],
            ['title' => "学校", "id" => 4, 'fields' => array('undergraduate','master_college','doctor_college','education','profession','current_status')],
            ['title' => "工作", "id" => 5, 'fields' => array('work_org','work_status','occupation','work_type','year_salary')],
            ['title' => "住房/家庭情况", "id" => 8,'fields' => array('goufang_condition','famliy_condition')],
            ['title' => "想说的话", "id" => 9, 'fields' => array('about_me','about_you')],
        );

        return $model_set_fields;
    }

}

